import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:convert';

part 'special_response.freezed.dart';
part 'special_response.g.dart';

@freezed
class SpecialResponse with _$SpecialResponse {
  const factory SpecialResponse({
    @JsonKey(name: "c") required int c,
    @JsonKey(name: "m") required String m,
    @JsonKey(name: "d") required List<D> d,
  }) = _SpecialResponse;

  factory SpecialResponse.fromJson(Map<String, dynamic> json) =>
      _$SpecialResponseFromJson(json);
}

@freezed
class D with _$D {
  const factory D({
    @JsonKey(name: "id") required String id,
    @JsonKey(name: "title") required String title,
    @JsonKey(name: "desc") required String desc,
    @JsonKey(name: "time") required String time,
    @JsonKey(name: "url") required String url,
    @JsonKey(name: "thumb") required String thumb,
  }) = _D;

  factory D.fromJson(Map<String, dynamic> json) => _$DFromJson(json);
}
